package Q344;

/**
 * 反转字符串（不使用api)
 * @author 23737
 * @time 2021.12.4
 */
public class Test {
    public static void main(String[] args) {

    }
}

class Solution {
    public void reverseString(char[] s) {
        for (int i = 0; i < s.length; i++) {
            if(i == s.length/2){
                break;
            }
            char temp = s[s.length-i-1];
            s[s.length-i-1] = s[i];
            s[i] = temp;
        }
    }
}